import { ref } from 'vue'
import { defineStore } from 'pinia'
import { layoutGetAllCategories } from '@/apis/layout'

export const useCategoryStore = defineStore('category',()=>{
  //导航分类数据
  const allCategories = ref([])
  //获取导航分类数据的方法
  const getAllCategories = async  ()=>{
    const res = await layoutGetAllCategories()
    allCategories.value = res.data.result
  }

  return{
    allCategories,
    getAllCategories
  }
})
